package com.sright.bcard.content.dal.mapper;

import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.entity.UserDO;
import com.sright.bcard.content.dal.result.EnterpriseMemberResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserDOMapper extends BaseMapper<UserDO> {

    int deleteByPrimaryKey(Long id);

    List<UserDO> selectByEnterpriseId(@Param("enterpriseId") Long enterpriseId);

    List<UserDO> selectVerifyUser(@Param("memberId") Long memberId);

    UserDO selectUnVerifyUser(@Param("id") Long id);

    Integer unbind(@Param("id") Long id);

    UserDO selectVerifyEnterpriseUser(@Param("memberId") Long memberId);

    List<Map<String, Object>>  selectUserCountGroupByEnterprise(@Param("enterpriseIdList") List<Long> enterpriseIdList);

    Long selectBindUserNumById(@Param("enterpriseId")Long enterpriseId);

    Integer selectUserCountByEnterpriseId(@Param("enterpriseId") Long enterpriseId, @Param("keywords") String keywords);

    List<EnterpriseMemberResult> selectUserInfoByEnterpriseId(@Param("enterpriseId") Long enterpriseId, @Param("keywords") String keywords,
                                                              @Param("paramRequest") PageParamRequest paramRequest);

    Long selectCreatedUserNum(@Param("enterpriseId") Long enterpriseId);

    Long selectPersonalUserIdByOldId(@Param("oldPersonalUserId") Long oldPersonalUserId);

    Long selectEnterpriserUserIdByOldId(@Param("oldEnterpriseUserId") Long oldEnterpriseUserId);

    List<UserDO> selectAllUserByMemberId(@Param("memberId") Long memberId);

    Integer updateDelete(@Param("id") Long id);
}